

from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from goods.models import SpecificationOption
from meiduo_admin.serializers.option_serializers import *
from meiduo_admin.custom_page import MyPage
from meiduo_admin.serializers.spec_serializers import *


# 序列化返回可选规格信息
class SpecSimpleListView(ListAPIView):
    queryset = SPUSpecification.objects.all()
    serializer_class = SpecDetailModelSerializer


class OptionModelViewSet(ModelViewSet):
    queryset = SpecificationOption.objects.all()
    serializer_class = OptionModelSerializer
    pagination_class = MyPage